import java.util.Scanner;

public class Main {
    //求n的阶乘
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("Please enter a number:");
        int n = sc.nextInt();
        int result = fac(n);
        System.out.println(n + "! =" + result);
    }

    public static int fac(int i) {
        int ret = 1;
        for (int j = i; j > 0; j--) {
            ret = ret * j;
        }
        return ret;
    }
}
    /*public class TestMethod {
        public static void main(String[] args) {
            add(1, 2);//调用add(int, int)
            add(1.5, 2.5);// 调用add(double, double)
            add(1.5, 2.5, 3.5);// 调用add(double, double,double)
        }
        public static int add(int x, int y) {
            return x + y;
        }
        public static double add(double x, double y) {
            return x + y;
        }
        public static double add(double x, double y, double z) {
            return x + y + z;
        }
    }
}*/
   /* public static void main(String[] args) {
        int sum = 0;
        int result = 1;
        for (int i = 1; i <= 5; i++) {
            sum += fac(i);
        }
        System.out.println("sum = " + sum);
    }

    public static int fac(int n) {
        int result = 1;
        for (int i = 1; i <= n; i++) {
            result = result * i;
        }
        return result;
    }
}*/
    /*public static int Add(int x,int y) {
        return x+y;
    }
    public static void main1(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("Please enter two numbers:");
        int a = sc.nextInt();
        int b = sc.nextInt();
        int ret = Add(a,b);
        System.out.println(ret);
    }
}*/
    /*public static boolean isLeapYear(int year) {
        if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {
            return true;
        } else {
            return false;
        }
    }
    public static void main(String[] args) {
        int year = 1900;
        boolean LeapYear =isLeapYear(year);
        System.out.println("Is "+year+" a LeapYear? " + LeapYear);
    }
}*/